<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Document</title>
  </head>

  <body>
    <div id="app"></div>
    <script>
      function Phone(name, price) {
        this.name = name
        this.price = price
      }
      Phone.prototype.call = function () {
        console.log("打电话")
      }
      function smartPhone(name, price, color, size) {
        Phone.call(this, name, price)
        this.color = color
        this.size = size
      }
      smartPhone.prototype = new Phone()
      smartPhone.prototype.constructor = smartPhone
      let apple = new smartPhone("苹果", 5999, "黑色", "5.5")
      console.log(apple)
      console.log(apple.__proto__.constructor)
    </script>
  </body>
</html>
